draw_text_3d with the whole line leaned the way italic writing leans: draws text in world space with the line curving away from you, and xshear slides the top of the letters sideways (a positive number leans them right, a negative number leans them left, and 0 is exactly draw_text_3d). shape and depth work exactly as they do in draw_text_3d: depth goes up to 6, and TEXT_DRUM and TEXT_BAND slide the word through a lens fixed on the middle of the screen. (x, y) is the same LEFT/CENTER/RIGHT anchor draw_text already uses. Inside a Draw GUI event it is fixed to the screen instead, and (x, y) counts from the screen’s top-left pixel.
Works differently on Game Boy - The Game Boy cannot squeeze letters row by row: with an xshear a 3D text on the screen leans in 4 steps of 2 lines and the shape is left out; without one it is as draw_text_3d (a copy behind, an arch, the lens).
Works differently on Game Boy Color - The Game Boy Color cannot squeeze letters row by row: with an xshear a 3D text on the screen leans in 4 steps of 2 lines and the shape is left out; without one it is as draw_text_3d (a copy behind, an arch, the lens).
Sega Genesis: not available
On other consoles this differs: see Side by side and How the consoles differ.
draw_text_3d_sheared(x, y, text, shape, depth, xshear)| Name | Type |
|---|---|
x | real |
y | real |
text | string |
shape | text_shape |
depth | int |
xshear | real |
Nothing.
draw_text_3d with a slant. The line of text curves away from you as it always did, and xshear leans the whole line the way italic writing leans. It is the same number draw_text_sheared and draw_sprite_sheared take, and it means the same thing here:
xshear is how many pixels the letters slide sideways for every pixel they are above or below their middle. At 0.5 the top edge of a letter 8 pixels tall (4 pixels above its middle) is 2 pixels to the right of where it would be, and its bottom edge is 2 pixels to the left. A positive number leans the letters to the right, a negative number leans them to the left, and 0 is exactly draw_text_3d.

The same call three times, with only the lean changing: 0, 0.5 and 1. Real pictures from a Game Boy Advance ROM, cropped and shown twice as big. The top one is draw_text_3d's own picture: the engine checks that, pixel for pixel, for every shape.
The first five numbers are draw_text_3d's own: (x, y), the text, the shape and the depth. The last one is the lean. Nothing about the first five changes:
(x, y) is a place in the room, counted from the room's top-left corner. text_align decides whether it is the left end, the middle or the right end of the line, and y is the middle of the line from top to bottom. Inside a Draw GUI event the call is fixed to the screen instead, and (x, y) counts from the screen's top-left pixel.shape is TEXT_BULGE, TEXT_LEAN_BACK, TEXT_LEAN_FORWARD, TEXT_DRUM or TEXT_BAND, and every one of them can lean.depth is a whole number from 0 to 6, and it works exactly as it does for draw_text_3d. Read that page for what every depth looks like and why the deep ones (4 to 6) want a big, bold font.

All five shapes, each leaning by 0.5. TEXT_DRUM and TEXT_BAND are a lens fixed on the middle of the screen, so their word is drawn there.
The lean and the curve work together. Where the curve squeezes a row of the letters, that row leans less, so the line leans like a real sign standing at an angle, not like a flat picture that has been pushed sideways. You do not have to do anything for that: it is the same number on every row, and the curve does the rest.
The lean can be a different number on every frame, and it costs almost nothing to change: the letters are not built again. A swinging lean, a lean that follows how fast something moves, a word that falls over when it is hit: all of them are one variable.


The xshear going 1, 0.92 ... 0 ... -1 and back (the number under the picture is the one in use). Sixteen real pictures, two frames apart, played at half the speed of the console. A viewer that does not animate shows the first frame.
depth 0 draws the flat line, and a flat line can lean too: it is draw_text_sheared with a scale of 1 and no turn. So you can switch the curve on and off with a variable and the lean stays. With a lean of 0 as well it is plain draw_text.
A note on 12. Twelve is how many sprites one drawn thing can use in every game that has not changed Sprites in one drawn thing under Engine limits in Project Settings (it goes up to 32). Wherever this page says 12 letters, it means that number.
Every letter of a word of 12 letters or fewer (spaces do not count) is a sprite of its own, and the Game Boy Advance draws a slanted sprite only inside a box twice as wide and twice as tall as the sprite. Anything that slides outside the box is cut off, and nothing can make the box bigger. The letters of the normal fonts are square (8 by 8, 16 by 16 or 32 by 32 pixels), and for a square letter that box holds this much:
xshear of up to 1 is whole. Checked on a real game running in an emulator, a lean of 1, which is 45 degrees, lost not one pixel of any letter in any of the five shapes, for letters 8, 16 and 32 pixels tall. A lean of -1 is the same. So 1 is the number to use as the most a letter can lean, and you never have to think about it for a lean you can read at all (past about 1.5 the letters are a smear anyway).TEXT_LEAN_FORWARD). The letters of a real font have empty edges and lose less than that. TEXT_BULGE is kinder: it kept every pixel at 2. Nothing worse than a cut-off side ever happens.0.5 for a letter 16 wide and 32 tall (the shape of the tall title fonts some of the examples ship) or 8 wide and 16 tall. Checked on both, a lean of 0.5 was whole in every shape, and at a lean of 1 a solid block kept about 91% of its pixels (16 by 32) and about 89% (8 by 16) in TEXT_LEAN_FORWARD, the worst shape (TEXT_BULGE still kept all of them). Keep the lean to 0.5 for a font like that, or draw with a font of square letters.draw_text_3d). A development build says so once in its log. Split a long line over two calls.

One letter and twelve letters, each at a lean of 0, 0.5 and 1. The twelve letters are in the 8 pixel font, because twelve of the 32 pixel font are wider than the screen. Every letter of the word leans exactly as the single letter does.
The curve is made for a single line of text. A "\n" in the string ends the text there: only the first line is drawn, and what follows is left out. To curve several lines, draw each with its own call.
It costs what draw_text_3d costs, and the lean adds nothing to the bill:
draw_text_3d takes. The lean is the same number on every row, so it needs no row-by-row effect of its own. A room change keeps two of the eight for itself, so there are six left for you: three 3D things at once (a text from draw_text_3d, draw_text_3d_scaled or this one, or a sprite from draw_sprite_3d), or two 3D things and two rippling sprites, and so on. A flat leaned line (depth 0) takes the matrix and none of the eight.0 goes back to the sprite's own box, so it costs exactly what draw_text_3d costs. A screen with very many sprites on the same rows can run out of time for them, and the console then leaves out the ones that do not fit: keep an eye on that if you lean a long word on a busy screen.draw_text_3d, and one whose lean changes on every frame costs about 1,000 more. A line that moves or changes its words is built again, and that costs about 87,000 cycles for twelve letters, about 8,000 more than draw_text_3d, because every new letter has to be given the matrix and the bigger box. (Measured on a real game running in an emulator, in a release build.)Ask for more than there is and the game stops, in a development build, with a message that names every call that is holding a slot (a 3D text, scaled or leaned, is named by its first letters). The line has already been drawn plain, upright and flat, when it stops, and a release build, which has no such stop, simply shows it that way. The effect never fails to appear: you are told.
text_align(ALIGN_CENTER);
draw_text_3d_sheared(x, y - 24, "LEAN", TEXT_BULGE, 4, 0.5);A label, centered above this instance, pinched at the top and bottom of every letter like a barrel seen close up, and leaning to the right like italic writing (depth 4 needs a bold 32 pixel font).
text_align(ALIGN_CENTER);
draw_text_3d_sheared(x, y - 24, "LEAN", TEXT_LEAN_BACK, 4, -0.5);A sign tipped back, with the letters leaning to the left as well.
text_align(ALIGN_CENTER);
var lean = wave(-1, 1, 120, 0);
draw_text_3d_sheared(x, y - 24, "LEAN", TEXT_BULGE, 4, lean);A word whose lean swings from -1 to 1 and back once every two seconds (120 frames), curved the whole time. A lean that changes is as cheap as one that stays.
Costs what draw_text_3d costs: ONE of the hardware’s 32 affine matrices and TWO of the console’s 8 row-by-row (H-Blank) effects, for as long as the call keeps being made. The lean is one more number in the same matrix and is the same on every row, so it needs no effect of its own, and changing it on every frame is nearly free (the letters are not built again). A room transition keeps two of the eight for itself, so at most three 3D things (texts, or sprites from draw_sprite_3d) can be on screen at once. A line with a lean is drawn in the bigger box (twice the sprite’s size in each direction, which the console takes about twice as long to draw), and a line with a lean of 0 goes back to the sprite’s own box. A letter that is as wide as it is tall (the normal fonts: 8 by 8, 16 by 16, 32 by 32) keeps every pixel up to an xshear of 1; a letter taller than it is wide (some title fonts are 16 wide and 32 tall) holds a lean of its width divided by its height, 0.5 for those, and past the limit the sides of the letters are cut off and nothing worse. Every letter gets a sprite of its own, so every letter leans by exactly what its own row asks and a word never leans in clumps. That holds for a word of up to 12 letters (spaces do not count). A longer word is still drawn, but its letters share sprites, up to four to a sprite, so it leans in clumps of letters; a development build says so once in the log, and drawing a long line as two calls keeps it even. Each letter counts toward the 128 sprites the screen can show at once, so a 12-letter word costs 12. depth 0 draws the flat line, leaned (draw_text_sheared with a scale of 1 and no turn: a matrix and no row-by-row effect), and with an xshear of 0 as well, plain draw_text. Asking for more than there is stops the game with a message that names every call holding a slot (the plain text has already been drawn when it stops, and a release build, which has no such stop, draws it upright and flat). Depths 4 to 6 need a font drawn from sprites 32 pixels tall (a smaller font is drawn at depth 3 and a development build says so once in the log). A line cannot also be turned: use draw_text_warped for that, without the curve, or draw_text_3d_scaled to make the line bigger, smaller or flipped.